#include "StdAfx.h"
#include "VersionLabelUI.h"

CVersionLabelUI::CVersionLabelUI(void)
{
}

CVersionLabelUI::~CVersionLabelUI(void)
{
}

void CVersionLabelUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
	RECT rcText = m_rcItem;
	rcText.top += 5;
	rcText.bottom += 5;
	int nLinks = 0;
	CBlueRenderEngineUI::DoPaintPrettyText(hDC, m_pManager, rcText, m_sText, 
		UICOLOR_EDIT_TEXT_NORMAL, UICOLOR__INVALID, NULL, nLinks,  m_uTextStyle & ~DT_SINGLELINE);
}

void CVersionLabelUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
	if(_tcscmp(pstrName,_T("pos")) == 0)
	{
		RECT rcPos = {0};
		LPTSTR pstr = NULL;
		rcPos.left = _tcstol(pstrValue,&pstr,10);
		ASSERT(pstr);
		rcPos.top = _tcstol(pstr + 1,&pstr,10);
		ASSERT(pstr);
		rcPos.right = _tcstol(pstr + 1,&pstr,10);
		ASSERT(pstr);
		rcPos.bottom = _tcstol(pstr + 1,&pstr,10);
		ASSERT(pstr);
		SetPos(rcPos);
		m_rcItem = rcPos;
	}
	else CControlUI::SetAttribute(pstrName, pstrValue);
}
